<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2.4.v-show指令</title>
    <script src="vue.js"></script>
</head>

<body>
    <div id="app">
        <button @click="changeIsShow">{{btnOne}}</button>
        <button @click="addAge"> {{btnTwo}}</button>
        <img v-show="isShow" src="images/monkey.gif" alt="">
        <img v-show="age>=18" src="images/monkey.gif" alt="">
    </div>
    <script>
        let app = new Vue({
            el: "#app",
            data: {
                btnTwo: "现在16，age>=18,大于18显示",
                btnOne: "切换显示隐藏",
                isShow: false,
                age: 16,
            },
            methods: {
                changeIsShow: function () {
                    this.isShow = !this.isShow;
                },
                addAge: function () {
                    this.age++;
                }
            },
        });
    </script>
</body>

</html>